	$(function(){
        //按钮单击时执行
        $("#home_faq_add_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
            
			if($("#faq_user").val() == ""){  
                toastr.warning("工单用户不能为空！");  
                $("#faq_user").focus();  
                return false;  
            }  
			if($("#faq_q").val() == ""){  
                toastr.warning("工单问题不能为空！");  
                $("#faq_q").focus();  
                return false;  
            }
			var faq_user = $('#faq_user').val();
			var faq_q = $('#faq_q').val();
            //Ajax调用处理
            var home_faq_add = $.ajax({
               type: "POST",
               url: "index.php?m=faq&c=faq_home&a=home_faq_add_do",
               data: "faq_user="+faq_user+"&faq_q="+faq_q,
               async: false
            }).responseText;
			if (home_faq_add == "1"){
				toastr.info("相同问题工单已存在，请更换后重新提交！");
			} else if (home_faq_add == "2") {
				toastr.success("恭喜您："+faq_user+" ，工单添加成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });